import Vue from 'vue'

/**权限指令**/
const has = Vue.directive('has', {
    inserted: function (el, binding, vnode) {
        // 获取页面按钮权限
        let btnValue = binding.value
        let btnPermissionsArr = vnode.context.$store.state.user.btnPermissions;
        if (btnPermissionsArr.indexOf(btnValue)==-1) {
            // el.style.display='none'
            el.parentNode.removeChild(el)
        }
    }
});
export { has }